import java.util.Objects;

public class Test {
    public static void main(String[] args) {
        String s1 = null;
        String s2=  "zhanglei";
//        System.out.println(s1.equals(s2));
        System.out.println(Objects.equals(s1, s2));//更安全, 不会出现空指针异常

        System.out.println("=================");

        System.out.println(Objects.isNull(s1));
        System.out.println(Objects.isNull(s2));
        System.out.println(Objects.nonNull(s1));
        System.out.println(Objects.nonNull(s2 ));


    }
}
